<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
    <div>
            <textarea name="" id="robot-txt" cols="30" rows="10"></textarea>
        <button id="submit-txt">提交</button>
    </div>
</body>

<script>
 $("#submit-txt").click(function(){
     let txt = $("#robot-txt").val();
     console.log(txt)
    $.ajax({
        type: 'post',
        contentType: 'application/x-www-form-urlencoded',
        url : "http://192.168.1.191:3001/api/upload/protocol",
        // url : "http://localhost:8081/upload/protocol",

        data : {
            txt,
        },
        dataType: 'json',
        success : function(res) {
            console.log("成功",res);
        },
        error : function(e){
            console.log("失败",e);
        }
    });


 })

</script>
</html>